<template>
    <div>
      <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="提现金额">
          <el-input v-model="form.limit_price" type="number" />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">提交</el-button>
        </el-form-item>
      </el-form>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                form: {
                    limit_price: ''
                }
            }
        },
        created() {
            this.getWithdraw()
        },
        methods: {
            async getWithdraw() {
                let res = await this.$Http.withdrawApi({type: 1})
                // console.log(res);
                this.form.limit_price = res.limit_price
            },
            async onSubmit() {
                let res = await this.$Http.withdrawApi({type: 2, limit_price: this.form.limit_price})
                // console.log(res)
                if (res === 1) {
                    this.$message.success('提交成功！')
                    this.getWithdraw()
                }
            }
        }
    }
</script>

<style lang="sass" scoped>

</style>